package stack;

public class Recursion {
    public static void main(String args[]) {
        line(1);
    }

    public static void line(int i) {
        if (i < 10)
            line(i + 1);
        System.out.print(String.format("%3d", i));
    }

    public static int fib(int n) {
        if (n == 0 || n == 1)
            return n;
        return fib(n - 2) + fib(n - 1);
    }

    public static int factorial(int n) {
        if (n == 0 || n == 1)
            return 1;
        return n * factorial(n - 1);
    }
}
